from config_params.config_info import MODULE_CLASS
import jmespath

class baseUtil:
    @staticmethod
    def create_instance(class_name, params_dict: dict = {}):
        modules = __import__(f"{MODULE_CLASS.get(class_name)}", fromlist=(class_name,))
        return modules.__dict__.get(class_name)(**params_dict)

    @staticmethod
    def get_instance_attr(class_name):
        modules = __import__(f"{MODULE_CLASS.get(class_name)}", fromlist=(class_name,))
        return modules.__dict__.get(class_name)
    @staticmethod
    def jme_path(exp, data):
        return jmespath.search(exp, data)
